/*
 * $Id: signal.c 111 2010-11-30 09:04:14Z hyunghwan.chung $
 *
   Copyright 2005-2009 Chung, Hyung-Hwan.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an  BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

#include <xp/bas/signal.h>
#include <xp/bas/errno.h>

#if defined(XP_USE_SYSCALL) && defined(XP_HAVE_SYS_SYSCALL_H)
#include <sys/syscall.h>
#endif

int xp_kill (xp_pid_t pid, int sig)
{
#ifdef _WIN32
	return -1;
#else
#ifdef SYS_kill
	return syscall (SYS_kill, pid, sig);
#else
	return kill (pid, sig);
#endif
#endif
}

int xp_raise (int sig)
{
#ifdef _WIN32
	/* TODO: */
	return -1;
#else
	return xp_kill (xp_getpid(), sig);
#endif
}
